package com.summer.ChengXuYuanMianShiJingDian;

import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.HashSet;
import java.util.Set;

public class Q1_1 {
    public boolean isUnique(String astr) {
        Set<Character> s = new HashSet<Character>();
        CharacterIterator it = new StringCharacterIterator(astr);
        char c;
        for (c = it.first();c!=CharacterIterator.DONE;c = it.next()){
            s.add(c);
        }
        if(s.size()==astr.length()){
            return true;
        }else{
            return false;
        }
    }
}
